#include <iostream>
#include "majestic.h"
#include <SFML/Graphics.hpp>
using namespace std;
Majestic::Player::Player(int tx,int ty,const char *img1,const char *img2,const char *img3,const char *img4,const char *img5,const char *img6,const char *img7,const char *img8)
{
    pos = 0;
    if(!pImage[0].LoadFromFile(img1)) cout << img1 << " not found";
    if(!pImage[1].LoadFromFile(img2)) cout << img2<< " not found";
    if(!pImage[2].LoadFromFile(img3)) cout << img3 << " not found";
    if(!pImage[3].LoadFromFile(img4)) cout << img4 << " not found";
    if(!pImage[4].LoadFromFile(img5)) cout << img5 << " not found";
    if(!pImage[5].LoadFromFile(img6)) cout << img6 << " not found";
    if(!pImage[6].LoadFromFile(img7)) cout << img7 << " not found";
    if(!pImage[7].LoadFromFile(img8)) cout << img8 << " not found";
    pspr[0].SetTexture(pImage[0]);
    pspr[1].SetTexture(pImage[1]);
    pspr[2].SetTexture(pImage[2]);
    pspr[3].SetTexture(pImage[3]);
    pspr[4].SetTexture(pImage[4]);
    pspr[5].SetTexture(pImage[5]);
    pspr[6].SetTexture(pImage[6]);
    pspr[7].SetTexture(pImage[7]);
    for (int i=0;i<8;i++)
    pspr[i].SetPosition(tx,ty);
}
Majestic::Player::Player()
{

}
void Majestic::Player::move(int x, int y)
{
    for(int i=0;i<8;i++)
	pspr[i].Move(x,y);
}
int Majestic::Player::getspeed()
{
	return speed;
}
void Majestic::Player::setspeed(int s)
{
	speed =s;
}
sf::Sprite &Majestic::Player::getsprite()
{
    return pspr[pos];
}
void Majestic::Player::changepos(int p)
{
    pos = p;
}
int Majestic::Player::getpos()
{
    return pos;
}
